<{*通用兑换模板记录*}>
<{include file="Public/top.html" }>
</head>
<body>
<div id="warpper">
    <div class="content">
        <div class="location">积分商城</div>
        <{include file= "PointMall/nav.html"}>
        <div class="filedSet" style="padding-bottom: 0;">
            <div class="search">

                <form action="<{U('PointMall/exchangeSearch')}>"  id="searchForm" class="ui-form reportForm" method="get">
                    <input name="m" type="hidden" value="<{$module}>">
                    <input name="c" type="hidden" value="<{$controller}>">
                    <input name="a" type="hidden" value="<{$action}>">
                    <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                    <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">

                    <div class="ui-form-item inline-block">
                        <label class="ui-label">时间段</label>
                        <input type="text" name="startDate" id="startDate" class="ui-text startDate" value="<{$startDate}>"/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">—&nbsp;&nbsp;&nbsp;</label>
                        <input type="text" name="endDate" id="endDate" class="ui-text endDate" value="<{$endDate}>"/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">关键字</label>
                        <input type="text" style="width: auto;" name="keywords" class="ui-text bg-text keyword" placeholder="活动名/昵称/姓名/手机号" value="<{$keywords}>"/>
                    </div>
                    <div class="ui-form-item inline-block">
                        <label class="ui-label">活动名</label>
                        <select class="ui-select" id="pointMall" name="id">
                            <option value="0">全部</option>
                            <{foreach from=$pointMallList item=item}>
                            <option value="<{$item.id}>" <{if $id eq $item.id}>selected<{/if}>><{$item.titleList}></option>
                            <{/foreach}>
                        </select>
                    </div>
                    <div class="ui-form-item inline-block">
                        <button type="submit" class="ui-button" onclick="LayerShow();">查询</button>
                        <button type="button" onclick="exportData();" class="ui-button">导出</button>
                    </div>
                </form>
            </div>
        </div>
        <!--表格内容-->
        <div class="mainGrid">
            <table class="ui-table ui-body">
                <thead>
                    <tr>
                                    <th class="pct20">兑换时间</th>
                                    <th class="pct20">活动名</th>
                                    <th class="pct10">用户昵称</th>
                                    <th class="pct10">用户姓名</th>
                                    <th class="pct12">卡券号</th>
                                    <th class="pct12">手机号码</th>
                                    <th class="pct20">地址</th>
                                    <th class="pct10 last-col">状态</th>
                    </tr>
                </thead>
                <tbody>
                <{if $list}>
                    <{foreach from = $list item=item}>
                    <tr>
                        <td><{'Y-m-d H:i'|date:$item.exchangeTime}></td>
                        <td><{$item.titleList}></td>
                        <td><{$item.nickname}></td>
                        <td><{$item.realName}></td>
                        <td><{$item.cardNum}></td>
                        <td><{$item.phone}></td>
                        <td><{$item.address}></td>
                        <td><{$statusEnum[$item.status]}></td>
                    </tr>
                    <{/foreach}>
                <{else}>
                    <tr><td colspan="8">暂无数据</td></tr>
                <{/if}>
                </tbody>
            </table>
        </div>
        <!--描述：分页-->
        <div class="pagination">
            <{include file="Public/page.html"}>
        </div>
    </div>
</div>
<{include file="Public/foot.html" }>
<script>
    datePickter('startDate','endDate',true);
    //名单导出
    function exportData(){
        var exportUri = "<{U('exchangeSearch')}>";
        window.location.href = exportUri+'&export=1'
                +'&id='+$("#searchForm select[name='id']").val()
                +'&startDate='+$("#searchForm input[name='startDate']").val()
                +'&endDate='+$("#searchForm input[name='endDate']").val()
                +'&keywords='+$("#searchForm input[name='keywords']").val();

    }
</script>
